package oopday02;
//创建Fish类，继承Animal类
/*public class Fish extends Animal implements Swim{
    //1.1创建Fish类的 无参构造方法
    Fish() {
    }

    //1.2 创建Fish类的 全参构造方法
    Fish(String name, int age, String color) {
        super(name, age, color);
    }
    //2，重写eat方法
    void eat(){
        System.out.println(color+"色的"+age+"岁的"+name+"正在吃小虾");
    }

    public void swim(){
        System.out.println(color+"色的"+age+"岁的"+name+"正在游泳");
    }
}*/
public class Fish extends Animal implements Swim{
    Fish(String name, int age,String color){
        super(name, age, color);
    }
    public void swim(){
        System.out.println(color+"色的"+age+"岁的小鱼"+name+"正在游泳");
    }
    void eat(){
        System.out.println(color+"色的"+age+"岁的小鱼"+name+"正在吃小虾");
    }
}
